package usr

import (
	"sync"
	"time"
	"xian-server/lib/database"
)

type BaseUsrId string

type BaseUsr struct {
	Id string `db:"id"`
	
	// 代码
  Code string `db:"code"`
	
	// 头像
  AvatarImg string `db:"avatar_img"`
	
	// 名称
  IsOk int8 `db:"is_ok"`
	
	// 用户名
  Username string `db:"username"`
	
	// 密码
  Password string `db:"password"`
	
	// 创建人
  CreateUsrId string `db:"create_usr_id"`
	
	// 创建人
  CreateUsrIdLbl string `db:"create_usr_id_lbl"`
	
	// 更新人
  UpdateUsrId string `db:"update_usr_id"`
	
	// 更新人
  UpdateUsrIdLbl string `db:"update_usr_id_lbl"`
	
	// 删除人
  DeleteUsrId string `db:"delete_usr_id"`
	
	// 删除人
  DeleteUsrIdLbl string `db:"delete_usr_id_lbl"`
	
	// 删除时间
  DeleteTime time.Time `db:"delete_time"`
	
}

func (m BaseUsr) Table() string {
	return "base_usr"
}

func (m BaseUsr) INew() database.IModel {
	return m.New()
}

func (m BaseUsr) GetId() string {
	return m.Id
}

func (m BaseUsr) Database() string {
	return ""
}

func (m BaseUsr) New() *BaseUsr {
	return &BaseUsr{}
}

func (m BaseUsr) NewSplice() *[]BaseUsr {
	return &[]BaseUsr{}
}

var (
	instanceBaseUsrModel *BaseUsr
	onceBaseUsrModel     sync.Once
)

func NewBaseUsrModel() *BaseUsr {
	onceBaseUsrModel.Do(func() {
		instanceBaseUsrModel = &BaseUsr{}
	})
	return instanceBaseUsrModel
}
